using Microsoft.AspNetCore.Mvc;
using RuoVea.ExDto;
using RuoVea.OmiReports.Test;

namespace Controllers
{

    public class TestCurrentUser : ICurrentUser
    {
        public long UserId { get => 2024090915570001; set => throw new NotImplementedException(); }
        public long TenantId { get => 0; set => throw new NotImplementedException(); }
        public string Account { get => "�����û�"; set => throw new NotImplementedException(); }
        public string Name { get => "�����û�"; set => throw new NotImplementedException(); }
        public bool IsSuperAdmin { get =>false; set => throw new NotImplementedException(); }
        public bool IsTenantAdmin { get => false; set => throw new NotImplementedException(); }

        public T User<T>() where T : class
        {
            return null;
        }
    }

    /// <summary>
    /// 
    /// </summary>
    [ApiController]
    [Route("[controller]")]
    [EndpointGroupName("v0")]
    public class WeatherForecastController : ControllerBase
    {
        private static readonly string[] Summaries = new[]
        {
            "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
        };

        private readonly ILogger<WeatherForecastController> _logger;
        /// <summary>
        /// 
        /// </summary>
        /// <param name="logger"></param>
        public WeatherForecastController(ILogger<WeatherForecastController> logger)
        {
            _logger = logger;
        }
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public IEnumerable<WeatherForecast> Get()
        {
            return Enumerable.Range(1, 5).Select(index => new WeatherForecast
            {
                Date = DateTime.Now.AddDays(index),
                TemperatureC = Random.Shared.Next(-20, 55),
                Summary = Summaries[Random.Shared.Next(Summaries.Length)]
            })
            .ToArray();
        }
    }
}
